import java.util.Scanner;

public class TestDemo {
    //输入年龄判断
    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int age = scanner.nextInt();
        if(age < 18){
            System.out.println("少年");
        }
        else if(age < 29){
            System.out.println("青年");
        }
        else if(age < 56){
            System.out.println("中年");
        }
        else{
            System.out.println("老年");
        }
    }
    //判断输入数是否为素数
    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        boolean flag = true;
        if(num != 1){
            for(int i = 2;i < num ;i++){
                if(num % i == 0){
                    flag = false;
                    break;
                }
            }
        }
        else{
            flag = false;
        }
        if(flag){
            System.out.println("输入数是素数");
        }
        else{
            System.out.println("输入数不是素数");
        }
    }
    //打印素数
    public static void main4(String[] args) {
        int count = 0;
        for(int i = 1;i < 100;i++){
            int flag = 1;
            for(int j = 2;j < i;j++) {
                if (i % j == 0) {
                    flag = 0;
                    break;
                }
            }
            if (flag != 0 && i != 1) {
                System.out.println(i);
                count++;
            }
        }
        System.out.println("共有"+count+"个素数");
    }
    //输出润年
    public static void main3(String[] args) {
        for(int year = 1000 ; year < 2001 ; year++){
            if((year % 4 == 0)&&(year % 100 != 0)||(year % 400 ==0)){
                System.out.println(year);
            }
        }
    }
    //数九问题
    public static void main2(String[] args) {
        int i = 0;
        int count = 0;
        for(i = 1 ; i < 101 ; i++){
             if(i % 10 == 9)
                 count++;
             if(i / 10 == 9)
                 count++;
        }
        System.out.println("1~100共有"+count+"个9");
    }
    //打印1~100中能被3整除也能被5整除的数
    public static void main1(String[] args) {
        int i=0;
        for(i=1 ; i<101 ; i++){
            if((i % 3 != 0) || (i % 5 != 0)){
                continue;
            }
            System.out.println(i);
        }
    }
}
